﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
  <xsl:output method="xml" indent="yes" encoding="utf-8" media-type="text/xml" />
  
  <xsl:include href="../Utility.xslt"/>
  <xsl:param name="relrootpath"/>
  <xsl:param name="eventname" select="'ContactApproved'"/>
  <xsl:param name="userid" />
  <xsl:param name="lastupdate" />

  <xsl:template match="/Context">
    <Transform>
      <Content>
        <div class="datetext">
          <xsl:value-of select="$lastupdate"/>
        </div>
        <xsl:apply-templates select="Events[@EventName=$eventname]">
        </xsl:apply-templates>
      </Content>
    </Transform>
    
  </xsl:template>

  <xsl:template match="Events[@EventName='ContactApproved']">
    <div>
      <dl>
        <dt>
          <xsl:call-template name="IconSet">
            <xsl:with-param name="c">ns-addcontact</xsl:with-param>
          </xsl:call-template>
          <span class="iconlabel">
          <control kind="userlink">
            <xsl:attribute name="UserId">
              <xsl:value-of select="$userid"/>
            </xsl:attribute>
          </control>
          <xsl:text>和</xsl:text>
          
          <xsl:call-template name="JoinUserLink">
            <xsl:with-param name="valueList" select="Event">
            </xsl:with-param>
            <xsl:with-param name="separator" select="', '"/>
          </xsl:call-template>
          
          <xsl:text>成为了好友。</xsl:text>
          </span> 
        </dt>
      </dl>
    </div>
  </xsl:template>
 
</xsl:stylesheet>
